﻿using DFGK_WMS.IRepository;
using DFGK_WMS.Model.Models;
using DFGK_WMS.WebAPI.Controllers.Result;
using Microsoft.AspNetCore.Mvc;

namespace DFGK_WMS.WebAPI.Controllers.基础数据
{

    [Route("api/[controller]/[action]")]
    [ApiController]
    public class SchedulerController: ControllerBase
    {
        public SchedulerController(ISchedulerRepository schedulerRepository)
        {
            this.schedulerRepository = schedulerRepository;
        }

        public ISchedulerRepository schedulerRepository { get; set; }


        /// <summary>
        /// 更新质量等级
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult UpQualityState()
        {
            string message;
            var create = schedulerRepository.UpQualityState(out int count);
            if (create)
            {
                return Ok(BaseResult.Result(true, "更新成功" + count + "条", "200"));
            }
            return Ok(BaseResult.Result(false, "更新失败", "500"));
        }

    }
}
